#ifndef MYGLWIDGET_H
#define MYGLWIDGET_H

#include <QObject>
#include <QGLWidget>
#include <QColor>
#include <Cg/cg.h>		// NEW: Cg Header
#include <Cg/cgGL.h>	// NEW: Cg OpenGL Specific Header
#include <QTimer>

#define SIZE 64			// Defines The Size Of The X/Z Axis Of The Mesh

class MyGLWidget : public QGLWidget {
    Q_OBJECT
public:
    explicit MyGLWidget(QWidget *parent = 0);
	~MyGLWidget();
	void initializeGL();
	void resizeGL(int width, int height);
	void paintGL();
signals:

public slots:
	void manage_cg(bool enable);

private:
	int cnt;
	QColor background;
	QTimer timer;
	int width, height;
	bool		cg_enable, sp;						// Toggle Cg Program On / Off, Space Pressed?
	GLfloat		mesh[SIZE][SIZE][3];						// Our Static Mesh
	GLfloat		wave_movement;						// Our Variable To Move The Waves Across The Mesh

	CGcontext	cgContext;									// A Context To Hold Our Cg Program(s)
	CGprogram	cgProgram;									// Our Cg Vertex Program
	CGprofile	cgVertexProfile;							// The Profile To Use For Our Vertex Shader
	CGparameter	position, color, modelViewMatrix, wave;		// The Parameters Needed For Our Shader
};

#endif // MYGLWIDGET_H
